package day13_net.com.itheima.d4_tcp;

import java.io.DataInputStream;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

public class Server1 {
    public static void main(String[] args) throws Exception{
        System.out.println("服务器启动..");

        ServerSocket serverSocket = new ServerSocket(9999);
        Socket socket = serverSocket.accept();
        InputStream is = socket.getInputStream();

        DataInputStream dis = new DataInputStream(is);
        System.out.println("dis.readInt() = " + dis.readInt());
        System.out.println("dis.readUTF() = " + dis.readUTF());
        socket.close();
    }
}
